{extend name="base" /}
{block name="css"}
<link rel="stylesheet" href="/static/css/admin/skins/skin-blue.min.css"type="text/css"/>
<link rel="stylesheet" href="/static/css/admin/index.css" type="text/css"/>
<style>
    .msg1 {
        position: absolute;
        top: 50%;
        right: 11%;
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background-color: #fff0f0;
        margin-left: 5px;
    }
    #top::-webkit-scrollbar {
        display: none;
    }
</style>
{/block}
{block name="js"}
<script src="/static/js/admin/index.js?v={$v}"></script>
{/block}
{block name="main"}
<style>body,.wrapper{overflow:hidden;}</style>
<div class="wrapper">
    <header class="main-header">
        <a href="#" class="logo">
            <span class="logo-mini"><img width="30px" src="/static/img/admin/tyqz_mini.png?v=2.0"></span>
            <span class="logo-lg"><img width="100px" src="/static/img/admin/tyqz.png?v2.0"></span>
        </a>
        <nav class="navbar navbar-static-top">
            <div class="navbar-custom-menu" style='float:left'>
                <ul class='nav navbar-nav'>
                </ul>
            </div>
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <li id='toClearCache'><a class='j-clear-cache' href='#'><i class='fa fa-spinner'></i></a></li>
                    <li id='toLogout'><a class='j-logout' href='#' title='退出系统'><i class='fa fa-power-off'></i></a></li>
                </ul>
            </div>
        </nav>
    </header>
    <aside class="main-sidebar">
        <section class="sidebar">
            <div class="user-panel">
                <div class="pull-left image" style="
border-radius: 20px;">
                    <img src="/static/img/admin/tyqz_mini.png?v=2.0" class="img-circle" alt="User Image">
                </div>
                <div class="pull-left info">
                    <p>{$Think.session.SYS_STAFF.loginName}</p>
                </div>
                <div class='pull-left button'>
                    <a href='javascript:void(0);' class='j-edit-pass edit-pass'><i class='fa fa-key'></i><span>修改密码</span></a>
                    <a href='javascript:void(0);' class='j-edit-self edit-pass'><i class='fa fa-key'></i><span>修改资料</span></a>
                </div>
            </div>
            <div style="overflow-y: scroll;max-height: 80vh;" id="top">
                {volist name="menus" key='key0' id='left0'}
                <ul class="sidebar-menu" data-widget="tree">
                    <li class="treeview j-menulevel0 j-sysmenu">
                        <a href="#">
                            <i class="fa {$left0['menuIcon']?$left0['menuIcon']:'fa-eercast'}"></i> <span>{$left0['name']}</span>
                            <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                        </a>
                        {if !empty($left0['child'])}
                        {volist name="left0['child']" id='left1'}
                        <ul class="treeview-menu">
                            <li>
                                <a class='menu' href="{:Url($left1['path'])}" dataid='1' target="iframe">
                                    <i class="fa {$left1['menuIcon']?$left1['menuIcon']:'fa-circle-o'}"></i>
                                    {$left1['name']}
                                </a>
                            </li>
                        </ul>
                        {/volist}
                        {/if}
                    </li>
                </ul>
                {/volist}
            </div>
        </section>
    </aside>
    <div class="content-wrapper">
        <section class="content-header">
            <button id='toFullSreen' class="fullscreen"><i class="fa fa-arrows-alt"></i></button>
        </section>
    </div>
</div>
<div id='editPassBox' style='display:none;padding-top:5px;'>
    <form id='editPassFrom' autocomplete="off">
        <table class='wst-form'>
            <tr>
                <th style='width:100px'>原密码：</th>
                <td><input type='password' id='srcPass' name='srcPass' class='ipt' data-rule="原密码: required;" maxLength='16'/></td>
            </tr>
            <tr>
                <th>新密码：</th>
                <td><input type='password' id='newPass' name='newPass' class='ipt' data-rule="新密码: required;length[6~]" maxLength='16'/></td>
            </tr>
            <tr>
                <th>确认密码：</th>
                <td><input type='password' id='newPass2' name='newPass2' class='ipt' data-rule="确认密码: required;match(newPass);" maxLength='16'/></td>
            </tr>
        </table>
    </form>
</div>
<div id='editSelf' style='display:none;padding-top:5px;'>
    <form id='editSelfFrom' autocomplete="off">
        <table class='wst-form'>
            <tr>
                <th style='width:100px'>账号：</th>
                <td>{staffInfo['loginName']}</td>
            </tr>
            <tr>
                <th>昵称：</th>
                <td><input value="{staffInfo['userName']}" type="text" id='userName' name="userName" class='ipt' data-rule="昵称: required;" maxLength='16'/></td>
            </tr>
        </table>
    </form>
</div>
<script language="javascript">
    function showImg(opt){
        layer.photos(opt);
    }
    function showBox(opts){
        return WST.open(opts);
    }
    $('.treeview-menu li').click(function () {
        $('.treeview-menu li').removeClass('active');
        $(this).addClass('active');
    });
    //$('.treeview').click(function (event) {
    //    var index = $(".treeview").index(this);
    //    console.log(index);
    //    $(this).addClass('menu');
    //    $(".treeview").removeClass('menu-open active');
    ////    $(this).siblings()
    //});
    $(function(){
        $('#toClearCache').poshytip({content:'点击清除服务器缓存',showTimeout:0,hideTimeout:1,
            offsetY: 25,allowTipHover: false,timeOnScreen:1000});
        $('#toLogout').poshytip({content:'点击退出系统',showTimeout:0,hideTimeout:1,
            offsetY: 25,allowTipHover: false,timeOnScreen:1000});
        $('#toFullSreen').poshytip({content:'点击全屏展示',showTimeout:0,hideTimeout:1,
            offsetY: 25,allowTipHover: false,timeOnScreen:1000});
        getSysBossMessages();
        setInterval(function(){
            getSysBossMessages();
        },10000);
    })
    function getSysBossMessages(){
        $.post(WST.U('adminmall/index/getSysBossMessages'),{},function(data) {
            if (data.status > 0) {
                var num= data.data[0];
                if (num>0){
                    $('#msg_1').addClass('show').removeClass('hide');
                    $('#msg_2').addClass('show').removeClass('hide');
                }else{
                    $('#msg_1').addClass('hide').removeClass('show');
                    $('#msg_2').addClass('hide').removeClass('show');
                }
                var num1= data.data[1];
                if (num1>0){
                    $('#msg_3').addClass('show').removeClass('hide');
                    $('#msg_4').addClass('show').removeClass('hide');
                }else{
                    $('#msg_3').addClass('hide').removeClass('show');
                    $('#msg_4').addClass('hide').removeClass('show');
                }

            }

        });
    }
</script>
{/block}